home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / exploits / tests / nis / proto / include / nis_db.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-13  |  2.5 KB  |  111 lines

  1. /*
  2.  * Copyright (c) 1991, by Sun Microsystems Inc.
  3.  */
  4.  
  5. /*
  6.  * This header file defines the interface to the NIS database. All
  7.  * implementations of the database must export at least these routines.
  8.  * They must also follow the conventions set herein. See the implementors
  9.  * guide for specific semantics that are required.
  10.  */
  11.  
  12. #ifndef    _RPCSVC_NIS_DB_H
  13. #define    _RPCSVC_NIS_DB_H
  14.  
  15. #pragma ident    "@(#)nis_db.h    1.8    94/01/06 SMI"
  16.  
  17. #include <rpc/rpc.h>
  18. #include <rpcsvc/nis.h>
  19.  
  20. #ifdef    __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. enum db_status {
  25.     DB_SUCCESS = 0,
  26.     DB_NOTFOUND = 1,
  27.     DB_NOTUNIQUE = 2,
  28.     DB_BADTABLE = 3,
  29.     DB_BADQUERY = 4,
  30.     DB_BADOBJECT = 5,
  31.     DB_MEMORY_LIMIT = 6,
  32.     DB_STORAGE_LIMIT = 7,
  33.     DB_INTERNAL_ERROR = 8
  34. };
  35. typedef enum db_status db_status;
  36.  
  37. enum db_action {
  38.     DB_LOOKUP = 0,
  39.     DB_REMOVE = 1,
  40.     DB_ADD = 2,
  41.     DB_FIRST = 3,
  42.     DB_NEXT = 4,
  43.     DB_ALL = 5,
  44.     DB_RESET_NEXT = 6
  45. };
  46. typedef enum db_action db_action;
  47.  
  48. typedef entry_obj *entry_object_p;
  49.  
  50. typedef struct {
  51.     u_int db_next_desc_len;
  52.     char *db_next_desc_val;
  53. } db_next_desc;
  54.  
  55. struct db_result {
  56.     db_status status;
  57.     db_next_desc nextinfo;
  58.     struct {
  59.         u_int objects_len;
  60.         entry_object_p *objects_val;
  61.     } objects;
  62.     long ticks;
  63. };
  64. typedef struct db_result db_result;
  65.  
  66. /*
  67.  * Prototypes for the database functions.
  68.  */
  69.  
  70. #if (__STDC__)
  71.  
  72. extern bool_t db_initialize(char *);
  73. extern db_status db_create_table(char *, table_obj *);
  74. extern db_status db_destroy_table(char *);
  75. extern db_result *db_first_entry(char *, int, nis_attr *);
  76. extern db_result *db_next_entry(char *, db_next_desc *);
  77. extern db_result *db_reset_next_entry(char *, db_next_desc *);
  78. extern db_result *db_list_entries(char *, int, nis_attr *);
  79. extern db_result *db_add_entry(char *, int,  nis_attr *, entry_obj *);
  80. extern db_result *db_remove_entry(char *, int, nis_attr *);
  81. extern db_status db_checkpoint(char *);
  82. extern db_status db_standby(char *);
  83. extern db_status db_table_exists(char *);
  84. extern db_status db_unload_table(char *);
  85. extern void db_free_result(db_result *);
  86.  
  87. #else /* Non-prototype definitions */
  88.  
  89. extern bool_t db_initialize();
  90. extern db_status db_create_table();
  91. extern db_status db_destroy_table();
  92. extern db_result *db_first_entry();
  93. extern db_result *db_next_entry();
  94. extern db_result *db_reset_next_entry();
  95. extern db_result *db_list_entries();
  96. extern db_result *db_add_entry();
  97. extern db_result *db_remove_entry();
  98. extern db_status db_checkpoint();
  99. extern db_status db_standby();
  100. extern db_status db_table_exists();
  101. extern db_status db_unload_table();
  102. extern void db_free_result();
  103.  
  104. #endif  /* __STDC__ */
  105.  
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif    /* _RPCSVC_NIS_DB_H */
  111.